#include "PopupManager.h"
#include "MoreDetailDialogLoader.h"
#include "EquipDetailDialogLoader.h"
#include "SearchResultDialogLoader.h"
#include "EquipLevelUpDialogLoader.h"
#include "SelectItemDialogLoader.h"
#include "MeltOkDialogLoader.h"
#include "XiLianOkDialogLoader.h"
#include "BuyZhuRongJiDialogLoader.h"
#include "StaminaLackDialogLoader.h"
#include "ChallengePreviewDialogLoader.h"
#include "ChallengeResultDialogLoader.h"
#include "LevelUpDialogLoader.h"
#include "AwardEquipDialogLoader.h"

Dialog* PopupManager::getDialog( const string& name )
{
	if (name == "MoreDetailDialog")
	{
		RegisterLoader("MoreDetailDialog", MoreDetailDialogLoader::loader());
	}
	else if (name == "SearchResultDialog")
	{
		RegisterLoader("SearchResultDialog", SearchResultDialogLoader::loader());
	}
	else if (name == "EquipDetailDialog")
	{
		RegisterLoader("EquipDetailDialog", EquipDetailDialogLoader::loader());
	}
	else if (name == "EquipLevelUpDialog")
	{
		RegisterLoader("EquipLevelUpDialog", EquipLevelUpDialogLoader::loader());
	}
	else if (name == "SelectItemDialog")
	{
		RegisterLoader("SelectItemDialog", SelectItemDialogLoader::loader());
	}
	else if (name == "MeltOkDialog")
	{
		RegisterLoader("MeltOkDialog", MeltOkDialogLoader::loader());
	}
	else if (name == "XiLianOkDialog")
	{
		RegisterLoader("XiLianOkDialog", XiLianOkDialogLoader::loader());
	}
	else if (name == "BuyZhuRongJiDialog")
	{
		RegisterLoader("BuyZhuRongJiDialog", BuyZhuRongJiDialogLoader::loader());
	}
	else if (name == "StaminaLackDialog")
	{
		RegisterLoader("StaminaLackDialog", StaminaLackDialogLoader::loader());
	}
	else if (name == "ChallengePreviewDialog")
	{
		RegisterLoader("ChallengePreviewDialog", ChallengePreviewDialogLoader::loader());
	}
	else if (name == "ChallengeResultDialog")
	{
		RegisterLoader("ChallengeResultDialog", ChallengeResultDialogLoader::loader());
	}
	else if (name == "LevelUpDialog")
	{
		RegisterLoader("LevelUpDialog", LevelUpDialogLoader::loader());
	}
	else if (name == "AwardEquipDialog")
	{
		RegisterLoader("AwardEquipDialog", AwardEquipDialogLoader::loader());
	}

	std::string dialogName(name);
	dialogName.append(".ccbi");
	Dialog* dialog = (Dialog*)ReadNode(dialogName.c_str(), Framework::getSingletonPtr()->modelDialogLayer);
	return dialog;
}

